<?php
namespace Amis\form;
class ButtonGroupSelect extends FormItem
{
    public string $type = 'button-group-select';

    public function vertical(bool $vertical = false)
    {
        $this->vertical = $vertical;
        return $this;
    }

    public function tiled(bool $tiled = false)
    {
        $this->tiled = $tiled;
        return $this;
    }

    public function options(array $options = [])
    {
        $this->options = $options;
        return $this;
    }

    public function btnLevel($type = 'default')
    {
        if (in_array($type, ['link', 'primary', 'secondary', 'info', 'success', 'warning', 'danger', 'light', 'dark', 'default'])) {
            $this->btnLevel = $type;
        }
        return $this;
    }

    public function source($api = '')
    {
        $this->source = $api;
        return $this;
    }

    public function multiple(bool $multiple = false)
    {
        $this->multiple = $multiple;
        return $this;
    }

    public function labelField(string $labelField)
    {
        $this->labelField = $labelField;
        return $this;
    }

    public function valueField(string $valueField)
    {
        $this->valueField = $valueField;
        return $this;
    }

    public function joinValues(bool $joinValues = true)
    {
        $this->joinValues = $joinValues;
        return $this;
    }

    public function extractValue(bool $extractValue = false)
    {
        $this->extractValue = $extractValue;
        return $this;
    }

    public function autoFill(array $autoFill)
    {
        $this->autoFill = $autoFill;
        return $this;
    }
}